package com.yanze.controller;

import com.yanze.pojo.BaseJsonResult;
import com.yanze.pojo.Resource;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//@RestController
@Controller
public class HellowController {

    @Autowired
    Resource resource;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "hello springboot in IDEA refresh~~";
    }

    @ResponseBody
    @RequestMapping("/getResource")
    public Object getResource(){
        Resource bean = new Resource();
        BeanUtils.copyProperties(resource,bean);
        return BaseJsonResult.ok(bean);
    }
}
